<html lang='en'>
<head>
    <title>配置页面</title>
</head>
<style>
    .form {
        text-align: center;
    }
</style>
<script>
    function update() {
        const uid = document.getElementById('uid').value;
        const topic = document.getElementById('topic').value;
        const ajax = new XMLHttpRequest();
        ajax.open('GET', window.location.href + '/?uid=' + uid + '&topic=' + topic, true);
        ajax.send(null);
    }

    function setbright(bright) {
        document.getElementById('setbriht').innerText = bright;
        const ajax = new XMLHttpRequest();
        ajax.open('GET', window.location.href + '/?setbright=' + bright, true);
        ajax.send(null);
    }
</script>
<body>
<div class='form'>
    <form>
        <label>
            uid:<input id='uid' type='text' value='默认uid'>
        </label>
        <br>
        <label>
            topic:<input id='topic' type='text' value='默认topic'>
        </label>
        <br>
        <span>亮度</span>
        <label for='setbriht'>
        </label><input type='range' id='setbriht' max='100' min='5' onchange='setbright(this.value)' value='30'>
        <br>
        <button onclick='update()'>提交
        </button>
    </form>
</div>
</body>
</html>